<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // var fnReverse = function() {}
    function fnReverse(arr) {
      for (var i = 0; i < arr.length; i++) {
        if (i < Math.floor(arr.length/2) ) {
          var temp = arr[i];
          arr[i] = arr[arr.length-i-1];
          arr[arr.length-i-1] = temp;
        } else {
          break;
        }
      }
      return arr;
    };
    var arr1 = fnReverse([22,33,42,65,1,32]);
    console.log(arr1);
  </script>
</body>
</html>